<%@page import="models.AdsDealModel"%>
<%@page import="models.DealModel"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.TreeMap"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
TreeMap check = (TreeMap) request.getAttribute("check");
String success = (String) request.getAttribute("success");
String form = (String) request.getAttribute("form");
ArrayList<DealModel> deals = (ArrayList<DealModel>) request.getAttribute("deals");
AdsDealModel ads = (AdsDealModel) request.getAttribute("ads");
String type = (String) request.getAttribute("type");
%>

<jsp:include page="/admin/layouts/header.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>

<script type="text/javascript" src="/admin/js/form_ads_deal.js"></script>
		
		<div class="maincontent noright">
        	<div class="maincontentinner">
                <ul class="maintabmenu multipletabmenu">
                	<li class="<%=type.equalsIgnoreCase("top") ? "current" : "" %>"><a href="/admin/ads/top">Quản lý deal top</a></li>
                	<li class="<%=type.equalsIgnoreCase("right") ? "current" : "" %>"><a href="/admin/ads/right">Quản lý deal right</a></li>
                </ul><!--maintabmenu-->
                
                <div class="content">
					<jsp:include page="/admin/elements/message.jsp" />
					
                    <div class="contenttitle">
                    	<h2 class="form"><span>Danh sách các deal</span></h2>
                    </div><!--contenttitle-->
            
                    <form method="post" action="#" class="stdform" id="form_ads_deal">
                    	
						<p>
                        	<label>Chọn Deal</label>
                            <span class="formwrapper">
                            	<% for (int i = 0; i < deals.size(); i ++) { %>
                            	<span class="one_fourth">
                                    <input type="checkbox" name="id" value="<%=deals.get(i).getDealId() %>" <%//=ads.getIds().contains(deals.get(i).getDealId()) ? "checked=\"checked\"" : "" %>  /> <%=deals.get(i).getAbbreviation() %> <br />
                                </span>
                                <% } %>
                            </span>
                        </p>
                        
                        <br clear="all" /><br />
                        
                        <p class="stdformbutton">
                        	<button class="submit radius2">Cập nhật</button>
                            <input type="reset" value="Reset" class="reset radius2">
                        </p>
                        
                    </form>
                    
                    <br clear="all">
                    
                </div><!--content-->
                
            </div><!--maincontentinner-->
            
            <jsp:include page="/admin/elements/copyright.jsp">
            	<jsp:param name="language" value="1" />
			</jsp:include>
            
        </div>

<jsp:include page="/admin/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>